/*
 * @(#)InviteePickerDWRFacade.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.framework;

import java.util.ArrayList;
import java.util.List;
/**
  InviteePickerDWRFacade.java
  
  @author      Jim Zhou
  @company     DCIVision Limited
  @creation date   2006/11/24
  @version     $Revision: 1.3.4.1 $
*/
public class InviteePickerDWRFacade extends DWRFacade {

  public InviteePickerDWRFacade() {
    super();
  }
  
  /**
   * get user's email list.
   * @return                 List
   */
  public List getEmailList() {
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getResultList(InviteesPickerManager.E_MAIL,this.getSessionContainer());
  }

  /**
   * get user's id list.
   * @return                 List
   */
  public List getIdList() {
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getResultList(InviteesPickerManager.ID,this.getSessionContainer());
  }

  /**
   * get user's full name list.
   * @return                 List
   */
  public List getNameList() {
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getResultList(InviteesPickerManager.FULL_NAME,this.getSessionContainer());
  }

  /**
   * get user/group/role list,contains name,type("U","G","R"),id,email.
   * @return                 List
   */
  public List getResultList() {
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getResultList(this.getSessionContainer());
  }
  
  public List getResultListDynamic(
      boolean enableUser,
      boolean enableGroup,
      boolean enableRole,
      Integer choices,
      String key,
      ArrayList expectUserIDs,
      ArrayList expectGroupIDs,
      ArrayList expectRoleIDs){
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getResultListDynamic(
        enableUser,
        enableGroup,
        enableRole,
        choices,
        key,
        expectUserIDs,
        expectGroupIDs,
        expectRoleIDs,
        this.getSessionContainer());
  }

  /**
   * get group list ,contains name,id.
   * @return                 List
   */
  public List getGroupList(){
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getGroupList(this.getSessionContainer());
  }

  /**
   * get role list ,contains name,id.
   * @return                 List
   */
  public List getRoleList(){
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getRoleList(this.getSessionContainer());
  }

  /**
   * get staff hierarchy list ,contains name,id.
   * @return                 List
   */
  public List getStaffHierarchyList(){
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getStaffHierarchyList(this.getSessionContainer());
  }

  /**
   * get user's records ,contains id,full_name,title and hierarchy. 
   * The page infomation contains type("G","R","S"),searchKey,searchHierarchy,offset,pageSize,order,and "ASC" or "DESC"
   * @return                 List
   */
  public List getUserRecordsAndPageInfo(
      String searchUserName ,
      String searchType , 
      String searchKey , 
      String searchHierarchy , 
      String startOffset , 
      String pageSize , 
      String orderBy,
      String req ) {
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getUserRecordsAndPageInfo(searchUserName,searchType,searchKey,searchHierarchy,startOffset,pageSize,orderBy,req,this.getSessionContainer());
  }
  
  public List getGroupRecordsAndPageInfo (
      String searchGroupName ,
      String startOffset ,
      String pageSize ,
      String orderBy ,
      String req
  ){
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getGroupRecordsAndPageInfo(searchGroupName, startOffset, pageSize, orderBy, req, this.getSessionContainer());
  }
  
  public List getRoleRecordsAndPageInfo (
      String searchRoleName ,
      String startOffset ,
      String pageSize ,
      String orderBy ,
      String req
  ){
    InviteesPickerManager inviteesPickerManager = new InviteesPickerManager();
    return inviteesPickerManager.getRoleRecordsAndPageInfo(searchRoleName, startOffset, pageSize, orderBy, req, this.getSessionContainer());
  }
}
